//: Playground - noun: a place where people can play

import Foundation

import UIKit

var greeting = "hello"

greeting += " world"


println(greeting)

let world = " world"


println(world)

//greeting += world

greeting.append(Character("!"))

greeting = greeting.capitalizedString;

println(greeting)


var greeting1 = "hello".stringByAppendingString(" world").capitalizedString

println(greeting1)


var radius = 4

let pi = 3.14159

let million = 1_000_000

//var area = radius * radius * pi
var area = Double(radius) * Double(radius) * pi

println(area)

//var overFlow  = Int.max+1

let alwaysTrue = true

var address = (742, "Evergreen Terrace")

println(address.0)

println(address.1)

address.0 = 111

println(address)

var address1: (Int, String, String) = (711, "lou feng", "lian hua")

println(address1)

let (_,street1,stree2) = address1

println(street1)

var address2 = (number:111, street:"siqu")

println(address2.number)

var address3 = (333, "evergreen terrace")

let (house, street) = address3

let str1 = "i live at \(house+22222) \(street.uppercaseString)"

println(str1)

println("\\")

for i in 1..<5{
    //println(i)
}
println("1111")


var range = 1...5

println(range)

for i in "Swift"{
    //println(i)
}
/**
*  范围 1...5 1到5包括5  1..<5 不包括5
*/
greeting = "Swift by Tutorials Rocks!"

for i in range{
    if i == 5{
        println(greeting.uppercaseString)
    }else{
        //println(greeting)
    }
}

var direction = "down"

switch direction{
    case "down", "up":
    println("Going Down")
    default:
    println("Going Nowhere")
    
}

var score = 570

switch score{
    case 0..<10:
        println("novice")
    case 10..<100:
        println("proficient")
    case 100..<1000:
        println("rock-star")
    default:
        println("awesome")
}

/**
*  Switch 可以对应任何类型 字符串 数字 枚举 范围
*/

